package com.example.product.statemachine;

public enum PDEvent {

    EVENT1("EVENT1", "事件1"),
    EVENT2("EVENT2", "事件2"),
    EVENT3("EVENT3", "事件3"),
    EVENT4("EVENT4", "事件4");

    private String value;
    private String message;

    PDEvent(String value, String message) {
        this.value = value;
        this.message = message;
    }

    public static PDEvent getEvent(String value) {
        for (PDEvent event : PDEvent.values()) {
            if (event.getValue().equals(value)) {
                return event;
            }
        }
        return null;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
